package cn.tedu.jsd2207csmall.passport.service.impl;

import cn.tedu.jsd2207csmall.passport.mapper.RoleMapper;
import cn.tedu.jsd2207csmall.passport.pojo.vo.RoleListItemVO;
import cn.tedu.jsd2207csmall.passport.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Iterator;
import java.util.List;

@Service
public class RoleServiceImpl implements IRoleService {

    @Autowired
    RoleMapper roleMapper;

    @Override
    public List<RoleListItemVO> list() {

        List<RoleListItemVO> list = roleMapper.list();
        Iterator<RoleListItemVO> iterator = list.iterator();
        while (iterator.hasNext()){
         RoleListItemVO roleListItemVO=iterator.next();
         if (roleListItemVO.getId()==1){
             iterator.remove();
             break;
         }
        }
        return list;
    }


}
